The CxGrpNavBar object contains the following methods:
The AboutBox method displays an About dialog box for the control.
AboutBox()
Example
The following example displays the About dialog box.
|
Sub ShowAboutBox()
GrpNavBar.AboutBox
End Sub |
The CanNavNext method specifies whether the next target item (facility or node) can be selected.
CanNavNext(Wrap As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Wrap |
Yes |
If True, the selection wraps to the first node, if necessary. |
Example
The following example disables btnNavNext if the next target node cannot be selected. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub UpdateUI()
eboLevels.Text = GrpNavBar.X.Levels - 1
If cboLevel.Selection = 0 Then eboRules.Text = GrpNavBar.X.RootNodeRules Else eboRules.Text = _GrpNavBar.X.Rules(CInt(cboLevel.GetText(cboLevel.Selection))) End If
btnNext.Enable = GrpNavBar.X.CanSelNext(eboLevel.Text, ckbWrap.Value) btnPrev.Enable = GrpNavBar.X.CanSelPrev(eboLevel.Text, ckbWrap.Value)
btnNavNext.Enable = GrpNavBar.X.CanNavNext(ckbNavWrap.Value) btnNavPrev.Enable = GrpNavBar.X.CanNavPrev(ckbNavWrap.Value)
End Sub |
The CanNavPrev method specifies whether the previous target item (facility or node) can be selected.
CanNavPrev(Wrap As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Wrap |
Yes |
If True, the selection wraps to the last node, if necessary. |
Example
The following example disables btnNavPrev if the previous target node cannot be selected. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub UpdateUI()
eboLevels.Text = GrpNavBar.X.Levels - 1
If cboLevel.Selection = 0 Then eboRules.Text = GrpNavBar.X.RootNodeRules Else eboRules.Text = _GrpNavBar.X.Rules(CInt(cboLevel.GetText(cboLevel.Selection))) End If
btnNext.Enable = GrpNavBar.X.CanSelNext(eboLevel.Text, ckbWrap.Value) btnPrev.Enable = GrpNavBar.X.CanSelPrev(eboLevel.Text, ckbWrap.Value)
btnNavNext.Enable = GrpNavBar.X.CanNavNext(ckbNavWrap.Value) btnNavPrev.Enable = GrpNavBar.X.CanNavPrev(ckbNavWrap.Value)
End Sub |
The CanSelNext method returns True if the next item (facility attribute value or node) for the specified level can be selected. Otherwise returns False.
CanSelNext(Level As Integer, Wrap As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
The zero-based integer of the level. |
|
Wrap |
Yes |
If True, the selection wraps to the last node, if necessary. |
Example
The following example disables btnNext if the next node cannot be selected. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub UpdateUI()
eboLevels.Text = GrpNavBar.X.Levels - 1
If cboLevel.Selection = 0 Then eboRules.Text = GrpNavBar.X.RootNodeRules Else eboRules.Text = _GrpNavBar.X.Rules(CInt(cboLevel.GetText(cboLevel.Selection))) End If
btnNext.Enable = GrpNavBar.X.CanSelNext(eboLevel.Text, ckbWrap.Value) btnPrev.Enable = GrpNavBar.X.CanSelPrev(eboLevel.Text, ckbWrap.Value)
btnNavNext.Enable = GrpNavBar.X.CanNavNext(ckbNavWrap.Value) btnNavPrev.Enable = GrpNavBar.X.CanNavPrev(ckbNavWrap.Value)
End Sub |
The CanSelPrev method returns True if the previous item (facility attribute value or node) for the specified level can be selected. Otherwise returns False.
CanSelPrev(Level As Integer, Wrap As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
The zero-based integer of the level. |
|
Wrap |
Yes |
If True, the selection wraps to the last node, if necessary. |
Example
The following example disables btnPrev if the previous node cannot be selected. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub UpdateUI()
eboLevels.Text = GrpNavBar.X.Levels - 1
If cboLevel.Selection = 0 Then eboRules.Text = GrpNavBar.X.RootNodeRules Else eboRules.Text = _GrpNavBar.X.Rules(CInt(cboLevel.GetText(cboLevel.Selection))) End If
btnNext.Enable = GrpNavBar.X.CanSelNext(eboLevel.Text, ckbWrap.Value) btnPrev.Enable = GrpNavBar.X.CanSelPrev(eboLevel.Text, ckbWrap.Value)
btnNavNext.Enable = GrpNavBar.X.CanNavNext(ckbNavWrap.Value) btnNavPrev.Enable = GrpNavBar.X.CanNavPrev(ckbNavWrap.Value)
End Sub |
The EnableAllRootNodeRules method enables or disables all rules and vectors for the root node.
EnableAllRootNodeRules(Enable As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Enable |
Yes |
Set to True to enable all root node rules; set to False to disable all root node rules. |
Example
The following example enables all root node rules if ckbEnableAllFilterRules is checked. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub ckbEnableAllFilterRules_EventChange() Dim This : Set This = ckbEnableAllFilterRules
If ckbEnableAllFilterRules.Check = 1 Then
If cboLevel.Selection = 0 Then GrpNavBar.X.EnableAllRootNodeRules True Else GrpNavBar.X.EnableAllRules _CInt(cboLevel.GetText(cboLevel.Selection)), True End If
ListFilterRules End If
End Sub |
The EnableAllRules method enables or disables all rules and vectors, either unilaterally, or for the specified level. Passing True for Enable enables all rules; passing False disables all rules.
EnableAllRules(Level As Integer, Enable As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
The zero-based level for which to enable or disable rules. |
|
Enable |
Yes |
Set to True to enable all rules; set to false to disable all rules. |
Example
The following example enables all rules for the specified level when ckbEnableAllFilterRules is selected. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub ckbEnableAllFilterRules_EventChange() Dim This : Set This = ckbEnableAllFilterRules
If ckbEnableAllFilterRules.Check = 1 Then
If cboLevel.Selection = 0 Then GrpNavBar.X.EnableAllRootNodeRules True Else GrpNavBar.X.EnableAllRules _CInt(cboLevel.GetText(cboLevel.Selection)), True End If
ListFilterRules End If
End Sub |
The EnableRootNodeRule method enables or disables a rule or vector of rules by name for the root node.
EnableRootNodeRule(Name As String, Enable As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Name |
Yes |
Specifies the name of the rule or vector to enable or disable. |
|
Enable |
Yes |
Set to true to enable the rule or vector; set to false to disable the rule or vector. |
Example
The following example enables the selected root node rule when btnEnableRule is selected. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub btnEnableRule_EventClick() Dim This : Set This = btnEnableRule
If lboDisabledRules.GetCurSel() < 0 Then Exit Sub End If
If cboLevel.Selection = 0 Then GrpNavBar.X.EnableRootNodeRule _ lboDisabledRules.GetText(lboDisabledRules.GetCurSel()), True Else GrpNavBar.X.EnableRule CInt(cboLevel.GetText(cboLevel.Selection)), _ lboDisabledRules.GetText(lboDisabledRules.GetCurSel()), True End If
ListFilterRules()
End Sub |
The EnableRule method enables or disables the specified rule or set of rules for the specified level. True enables the rule or vector; False disables it.
EnableRule(Level As Integer, Name As String, Enable As Boolean)
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
Specifies the zero-based level for the rule or vector. |
|
Name |
Yes |
Specifies the name of the rule or vector. |
|
Enable |
Yes |
Set to True to enable the rule or vector; set to False to disable the rule or vector. |
Example
The following example enables the selected rule when btnEnableRule is selected. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub btnEnableRule_EventClick() Dim This : Set This = btnEnableRule
If lboDisabledRules.GetCurSel() < 0 Then Exit Sub End If
If cboLevel.Selection = 0 Then GrpNavBar.X.EnableRootNodeRule _ lboDisabledRules.GetText(lboDisabledRules.GetCurSel()), True Else GrpNavBar.X.EnableRule CInt(cboLevel.GetText(cboLevel.Selection)), _ lboDisabledRules.GetText(lboDisabledRules.GetCurSel()), True End If
ListFilterRules()
End Sub |
The GetAllNodesAttrValues method returns the attribute values of all nodes for the specified level. The AttributeId parameter can be a string or a number.
GetAllNodesAttrValues(Level As Integer, AttributeID As Variant) As Variant
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
The zero-based level for which to retrieve attribute values. |
|
AttributeID |
Yes |
The attribute ID can be specified by a string or a number. |
For AttributeID use the form "~criteria". (for example, "~attr0", "~cat")
Example
The following example stores the NodeID of each node from a specified level into an array, and displays each element of the array into a list box.
|
Sub GetAllAttr() Dim attr Dim attrList
attrList = GrpNavBar.GetAllNodesAttrValues(Level, "~nodeid")
lboAttributes.ResetContent For Each attr In attrList lboAttributes.AddString(attr) Next
End Sub |
The GetGrpNavBarCustomAttribute method retrieves the value of a custom attribute.
GetGrpNavBarCustomAttribute(AttributeNameOrDesc As String) As String
| Parameter | Required | Description |
|---|---|---|
|
AttributeNameOrDesc |
Yes |
The name or description of the attribute for which to set a value. |
Example
The following example displays the value of a custom attribute in a message box.
|
Sub
MsgBox GrpNavBar.X.GetGrpNavBarCustomAttribute("grp_navbar_attribute_0")
End Sub |
The GetRootNodeRuleNames method retrieves the names of enabled and disabled rules for the root node.
GetRootNodeRuleNames(EnabledNames As Variant, DisabledNames As Variant)
| Parameter | Required | Description |
|---|---|---|
|
EnabledNames |
Yes |
The list of enable rule names returned. |
|
DisabledNames |
Yes |
The list of disabled rule names returned. |
Example
The following example lists the enabled and disabled root node rule names. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub ListFilterRules()
lboEnabledRules.ResetContent lboDisabledRules.ResetContent
Dim aryEnabled, aryDisabled
If cboLevel.Selection = 0 Then GrpNavBar.X.GetRootNodeRuleNames aryEnabled, aryDisabled Else GrpNavBar.X.GetRuleNames cboLevel.GetText(cboLevel.Selection), _aryEnabled, aryDisabled End If
Dim i For i = 0 To UBound(aryEnabled) lboEnabledRules.AddString aryEnabled(i) Next
For i = 0 To UBound(aryDisabled) lboDisabledRules.AddString aryDisabled(i) Next
End Sub |
The GetRuleNames method returns the names of all rules or sets of rules that have a configured name for the specified level. Separate arrays are returned for rules that are enabled and for rules that are disabled.
GetRuleNames(Level As Integer, EnabledNames As Variant, DisabledNames As Variant)
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
The zero-based level for which to retrieve rule names. |
|
EnabledNames |
Yes |
The list of enable rule names returned. |
|
DisabledNames |
Yes |
The list of disabled rule names returned. |
Example
The following example lists the enabled and disabled rule names. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub ListFilterRules()
lboEnabledRules.ResetContent lboDisabledRules.ResetContent
Dim aryEnabled, aryDisabled
If cboLevel.Selection = 0 Then GrpNavBar.X.GetRootNodeRuleNames aryEnabled, aryDisabled Else GrpNavBar.X.GetRuleNames cboLevel.GetText(cboLevel.Selection), _aryEnabled, aryDisabled End If
Dim i For i = 0 To UBound(aryEnabled) lboEnabledRules.AddString aryEnabled(i) Next
For i = 0 To UBound(aryDisabled) lboDisabledRules.AddString aryDisabled(i) Next
End Sub |
The GetSelectedNodeAttrValue method returns the attribute value of the selected node for the specified level. The AttributeId parameter can be a string or a number.
GetSelectedNodeAttrValue(Level As Integer, AttributeID As Variant) As String
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
The zero-based level for which to retrieve an attribute value. |
|
AttributeID |
Yes |
The attribute to be retrieved. |
For AttributeID use the form "~criteria". (for example, "~attr0", "~cat")
Example
The following example gets either the Description, Category, or Node ID, based on the user’s selection.
|
Sub GetSelAttr(userAttr)
If userAttr = "Description" Then edtMessageBox.Text = GrpNavBar.X.GetSelectedNodeAttrValue(Level, "~desc") Elseif userAttr = "Category" Then edtMessageBox.Text = GrpNavBar.X.GetSelectedNodeAttrValue(Level, "~cat") Elseif userAttr = "NodeID" Then edtMessageBox.Text = GrpNavBar.X.GetSelectedNodeAttrValue(Level, "~nodeid") End If
End Sub |
The NavNext method navigates to the next target facility or node. Returns the number of the lowest-level combo box whose selection changed. The EventOnSelChangeLevel event is triggered when NavNext is called.
NavNext(Wrap As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Wrap |
Yes |
If True, the selection wraps to the first node, if necessary |
Example
The following example navigates to the next node when btnNavNext is clicked. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub btnNavNext_EventClick() Dim This : Set This = btnNavNext
Dim iLevel iLevel = GrpNavBar.X.NavNext(ckbNavWrap.Value)
UpdateUI()
End Sub |
The NavPrev method navigates to the previous target facility or node. Returns the number of the lowest-level combo box whose selection changed. The EventOnSelChangeLevel event is triggered when NavPrev is called.
NavPrev(Wrap As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Wrap |
Yes |
If True, the selection wraps to the last node, if necessary |
Example
The following example navigates to the previous node when btnNavPrev is clicked. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub btnNavPrev_EventClick() Dim This : Set This = btnNavPrev
Dim iLevel iLevel = GrpNavBar.X.NavPrev(ckbNavWrap.Value)
UpdateUI()
End Sub |
The SelFirst method selects the first node at the specified level.
SelFirst(Level As Integer) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
Sets the zero-based integer of the level. |
Example
The following example selects the first node in the first level.
|
Sub FirstNode()
GrpNavBar.SelFirst (0) edtMessageBox.Text = "First node selected"
End Sub |
The SelLast method selects the last node at the specified level.
SelLast(Level As Integer) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
Sets the zero-based integer of the level. |
Example
The following example selects the last node in the second level.
|
Sub LastNode()
GrpNavBar.SelLast (1) edtMessageBox.Text = "Last node selected"
End Sub |
The SelNext method selects the next item (facility attribute value or node) for the specified level. If Wrap is True, the selection wraps to the first item, if necessary. The EventOnSelChangeLevel event is triggered when SelNext is called.
SelNext(Level As Integer, Wrap As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
Sets the zero-based integer of the level. |
|
Wrap |
Yes |
If True, the selection wraps to the first node, if necessary. |
Example
The following example selects the next node when btnNext is clicked. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub btnNext_EventClick() Dim This : Set This = btnNext
Dim iRet iRet = GrpNavBar.X.SelNext(eboLevel.Text, ckbWrap.Value)
UpdateUI()
End Sub |
The SelNode method selects the first node at the specified level that matches the criteria.
SelNode(Level As Integer, Criteria As String) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
Sets the zero-based integer of the level. |
|
Criteria |
Yes |
Specifies filter criteria for the target node. |
For Criteria use the form "~criteria=value" (for example, "~desc=California", "~cat=S").
Example
The following example selects the node in the second level that has the description "California."
|
Sub SelCalif()
GrpNavBar.SelNode 1, "~desc=California" edtMessageBox.Text = "California’s node selected"
End Sub |
The SelPrev method selects the previous item (facility attribute value or node) for the specified level. If Wrap is True, the selection wraps to the last item, if necessary. The EventOnSelChangeLevel event is triggered when SelPrev is called.
SelPrev(Level As Integer, Wrap As Boolean) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Level |
Yes |
Sets the zero-based integer of the level. |
|
Wrap |
Yes |
If True, the selection wraps to the last node, if necessary. |
Example
The following example selects the previous node when btnPrev is clicked. This example is taken from CxGrpNavBar and CxGrpGrid Example.
|
Sub btnPrev_EventClick() Dim This : Set This = btnPrev
Dim iRet iRet = GrpNavBar.X.SelPrev(eboLevel.Text, True)
UpdateUI()
End Sub |
The SetGrpNavBarCustomAttribute method sets the value of a custom attribute.
SetGrpNavBarCustomAttribute(AttributeNameOrDesc As String, Value As String)
| Parameter | Required | Description |
|---|---|---|
|
AttributeNameOrDesc |
Yes |
Specifies the name or description of the attribute. |
|
Value |
Yes |
Sets the value for the attribute. |
Example
The following example specifies a custom attribute value:
|
Sub
GrpNavBar.X.SetGrpNavBarCustomAttribute "grp_navbar_attribute_0", "NEW_VAL"
End Sub |
The SetTargetNode method sets the target node that matches the criteria.
SelTargetNode(Criteria As String) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
Criteria |
Yes |
Specifies filter criteria for the target node. |
Example
The following example sets the target node to Cyg_Meter when the GrpNavBar object is started:
|
Sub GrpNavBar_EventInitialize() Dim This : Set This = GrpNavBar
GrpNavBar.SetTargetNode("~desc=Cyg_Meter")
End Sub |